// components/authorization/authorization.js
Component({
  properties: {

  },
  data: {
    isLogin:false
  },
  methods: {},
  lifetimes:{
    attached(){
      const app = getApp()
      this.setData({isLogin:!!app.token})
      const pages = getCurrentPages()
      const current = pages[pages.length - 1]
      if(!app.token){
        wx.navigateTo({
          url:'/pages/login/index?redirect' + current.route
        })
      }
    }
  }
})
